$(function(){
	
	var detailId=queryString('updateId');
	var flowId=queryString('flowid');
	//请求数据详情
	YuXi.Updates.requestDetail(detailId);

	YuXi.Updates.getInformationFlow(detailId);

	YuXi.Updates.init(
		detailId,
		flowId,
		"stayComment.jsp",//要返回跳转的页面
		18,//meunId
		"CommentFilter/getInfoTogether.do"//提交接口
		);
	
	$("#goback").click(function(){	
		window.history.back();
	})



	//确认提交按钮
	$("#requestUpdate").click(function(){
		YuXi.Updates.getInformation(0);
	})
	//修改模态框确认按钮
	$("#update").click(function(){
		YuXi.Updates.requestUpdate();//调用修改数据方法
		$("#updateModal").modal('hide');
	})
YuXi.util.get("getAllInformationQuality.do",null,function(data){
	 if(data.status){
		 var obj=data.object;
		 for(var i=0;i<obj.length;i++){				
			 $("#infoAndS-container").append("<input type='radio' name='infoLv' value='"+obj[i].id+"' ><span>"+obj[i].name+"</span></input>");
		 }
		 
	 }
});

YuXi.util.get("getAllTasCompletion.do",null,function(data){
	 if(data.status){
		 var obj=data.object;
		 for(var i=0;i<obj.length;i++){				
			 $("#taskFinsh-container").append("<input type='radio' name='taskLv' value='"+obj[i].id+"' > <span>"+obj[i].name+" </span></input>");
		 }
		 
	 }
});
		
//正则取链接传来的数据
function queryString(key)
{
    var regex_str = "^.+\\?.*?\\b"+ key +"=(.*?)(?:(?=&)|$|#)"
    var regex = new RegExp(regex_str,"i");
    var url = window.location.toString();
    if(regex.test(url)) return RegExp.$1;
    return undefined;
}
function modal(msg,cont){
	myTool.alert({		
		title:msg,
		context:cont,
		isMask:true,
		callback:function(){}
	});
}

})